package algorithm.beforestart;

import java.util.PriorityQueue;

//大根堆 小跟堆（默认）
public class Heap {
    public static void main(String[] args) {
//        PriorityQueue<Integer> priorityQueue =new PriorityQueue<>();
        PriorityQueue<Integer> priorityQueue =new PriorityQueue<>((x,y)->y-x);
        priorityQueue.add(6);
        priorityQueue.add(5);
        priorityQueue.add(3);
        while (priorityQueue.peek()!=null){
        System.out.println(priorityQueue.poll());
        }

    }
}
